package com.htfyun.ft.pccommand;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

/**
 * Created by sst on 2018/7/17.
 */

public class PCCommandReceiver extends BroadcastReceiver {

    public final static String TAG = "PCCommandReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        final String action = intent.getAction();

        if (action == null) {
            return;
        }

        Log.e(TAG, "action = " + action);

        startPCCommandHandleActivity(context, action);

    }

    private void startPCCommandHandleActivity(Context context, String action) {

        Intent intent = new Intent(context, PCCommandHandleActivity.class);
        intent.setAction(action);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);

    }
}
